package com.example.baomidou.controller;

import com.alibaba.fastjson2.JSONObject;
import com.example.baomidou.entity.Menu;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {


    @RequestMapping("/addMenu")
    public JSONObject addMenu(@RequestBody JSONObject params){
        JSONObject json = new JSONObject();



        return json;
    }

    @RequestMapping("/list")
    public JSONObject list(@RequestBody JSONObject params){
        JSONObject json = new JSONObject();

        List<Menu> menuList = new ArrayList<>();
        Menu menu = new Menu();
        menu.setId(1);
        menu.setName("aaa");
        menu.setUrl("menu/addmenu");
        menu.setType(1);
        menu.setPid(0);
        menuList.add(menu);


        json.put("data",menuList);

        return json;
    }
}
